package test

import kotlinx.coroutines.flow.*
import kotlinx.coroutines.runBlocking

object TestFlow {
  @JvmStatic
  fun main(args: Array<String>) {
    runBlocking {
      flow {
            emit("1-0")
            emit("1-1")
            emit(null)
          }
          .filterNotNull()
          .toList()
          .let { println(it) }
      val flow1 = flow {
        emit("1-0")
        emit("1-1")
        emit(null)
      }
      val flow2 = flow { emit("2-0") }
      flow1.zip(flow2) { a, b -> println("$a  $b") }.collect()
    }
  }
}
